import {request} from "./index"
/** 获取轮播图
 * 
 * @param {string} carouselEnum
 */
const getCarousel = (carouselEnum) => {
  return request.get("v2/app/carousel", {
    carouselEnum
  })
}

/** 通过type获取页面数据
 * 
 * @param {string} type
 */
const getPageData = (type) => {
  return request.get(`v2/app/article/type/${type}`, {})
}

/** 通过id获取页面数据
 * 
 * @param {string} id
 */
const getPageDataForId = (id) => {
  return request.get(`v2/app/article/get/${id}`, {})
}

/** 获取文章列表
 * 
 * @param {number} page
 */
const getarticle = (page) => {
  return request.get(`v2/app/article`, {
    page,
    size: 10,
    type: 'OTHER'
  })
}

export {
  getCarousel,
  getPageData,
  getarticle,
  getPageDataForId
}
